home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dsiic2.zip / PANEL2.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  1KB  |  48 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   PANEL2.C   ***************************/
  4.  
  5.  
  6. /*
  7. Demonstrate the creation of three window panels.
  8. The panels are unframed with the upper and lower panels
  9. displayed in inverse.
  10. The upper and lower panels occupy one line.
  11. */
  12.  
  13. #include "mydef.h"   /* always include this */
  14. #include <stddef.h>  /* we need the definition of NULL from here */
  15.  
  16. int start(int argc, char *argv[])
  17. {
  18. extern struct screen_structure scr;
  19. extern struct window_structure w[];
  20.  
  21. int top, middle, bottom;
  22.  
  23.  
  24.    cls();           /* clear initial window */
  25.    alt_screen(ON);  /* let's draw the windows off screen */
  26.  
  27.      /* calculate the window sizes to fit true column and row */
  28.      /* don't assume 80x25 */
  29.  
  30.      top=win_make(1,1,scr.columns,1,NO_FRAME,"",scr.normal,
  31.                   scr.inverse);
  32.                   print(1,1,"test panel 1");
  33.  
  34.      middle=win_make(1,2,scr.columns,scr.rows-2,"","",scr.normal,
  35.                      scr.normal);
  36.         print(1,1,"test panel 2");
  37.  
  38.      bottom=win_make(2,scr.rows,scr.columns,1,"","",scr.normal,
  39.                      scr.inverse);
  40.         print(1,1,"test panel 3");
  41.  
  42.      win_pop_top(middle);  /* make middle window topmost */
  43.  
  44.   alt_screen(OFF); /* show the finished screen */
  45.  
  46. return(0);
  47. }
  48.